package com.acip.uuid.mapper;

import com.acip.uuid.model.entity.CosIdSegment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.time.LocalTime;

@Repository
public interface CosIdSegmentMapper extends BaseMapper<CosIdSegment> {
    /**
     * 自增增加号段
     * @param id 号段id
     * @param segmentCount 号段数量
     * @return
     */
    @Update("update cosid_segment set auto_increment = auto_increment + #{segmentCount},update_time= #{updateTime} where id = #{id} ")
    Boolean updateCosIdSegmentAutoIncrement(@Param("id") Long id, @Param("segmentCount") Long segmentCount, @Param("updateTime")LocalDateTime updateTime);
}
